#include<bits/stdc++.h>

#define rp(i,a,b) for(int i=a;i<b;++i)
#define rrp(i,b,a) for(int i=b;i>=a;--i)

using namespace std;

int main(){
	long long n;scanf("%lld", &n);
	long long a[n],b[n];
	for (long long i = 0; i < n; ++i)
	{
		scanf("%lld", &a[i]);
	}
	rp(i , 0 , n)scanf("%lld", &b[i]);

	long long c[n];
	c[0]=a[0]*b[0];
	long long MAX = a[0];
	rp(i , 1 , n){
		c[i] = c[i-1];
		MAX = max(MAX,a[i]);
		if(MAX*b[i]>c[i]){
			c[i]=MAX*b[i];
		}
	}

	rp(i , 0 , n){
		printf("%lld\n", c[i]);
	}
	
	return 0;
}